/******************************************************************************
 * Copyright 2018 The Apollo Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/

/**
 * @file
 **/

#ifndef MODULES_PLANNING_TASKS_TRAFFIC_DECIDER_CREEPER_H_
#define MODULES_PLANNING_TASKS_TRAFFIC_DECIDER_CREEPER_H_

#include "modules/common/macro.h"
#include "modules/map/pnc_map/path.h"
#include "modules/planning/common/frame.h"
#include "modules/planning/common/reference_line_info.h"

namespace apollo {
namespace planning {

class Creeper {
 public:
  ~Creeper() = default;

  bool Run(Frame* frame, ReferenceLineInfo* reference_line_info);

 private:
  bool BuildStopDecision(const hdmap::PathOverlap& overlap,
                         const double stop_buffer,
                         const double max_creeping_target_distance,
                         Frame* frame, ReferenceLineInfo* reference_line_info);

  bool in_use_ = false;

  DECLARE_SINGLETON(Creeper);
};

}  // namespace planning
}  // namespace apollo

#endif  // MODULES_PLANNING_TASKS_TRAFFIC_DECIDER_CREEPER_H_
